package com.hm.add1_7;

public class Store {
    public Animal getInstance(String name){
        if(name.equals("dog")){
            return new Dog();
        }else if(name.equals("pig")){
            return new Pig();
        }else{
            return new Cat();
        }
    }
}
